package com.cg.service;

import com.cg.entity.User;
import com.cg.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    public void register(User user) {
        userMapper.insertUser(user);

    }
    public User login(String account,String password){
        User user=userMapper.getUserByAccountAndPassword(account,password);
        System.out.println(user);
        return user;
    }

    public User getUserInfo(String account,String password) {
        User user =userMapper.getUserByAccountAndPassword(account,password);
        return user;
    }
}
